<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>test</title>
</head>
<body>

</body>
</html>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.0.4/socket.io.js"></script>
<script type="text/javascript">
    function play(name) {
        var socket = io('http://192.168.60.143:8008');
        socket.on('connect', function () {
            console.log('connect');
            socket.emit('register', name, function (data) {
                console.log(data);
            });

            let angle = (Math.random() * 2) * Math.PI;
            socket.on('info', function (info) {
            });
            setInterval(function () {
                angle += (Math.random() * 0.05) * Math.PI;
                socket.emit('move', angle);
                socket.emit('shoot', (Math.random() * 2) * Math.PI);
            }, 5);
        });
    };
    play('BOB');
    play('COC');
    play('AOA');
</script>
